/**
 * ...
 * @author Thot
 */

function TextureManager()
{
	this._textures = new Array();
}

//static
TextureManager._instance = null;
TextureManager.getInstance = function()
{
	if( TextureManager._instance == null )
	{
		TextureManager._instance = new TextureManager();
	}
	
	return TextureManager._instance;
};

// public

TextureManager.prototype._textures = null;

TextureManager.prototype.addTexture = function( p_texture )
{
	this._textures[p_texture.id] = p_texture;
};

TextureManager.prototype.getTextureById = function( p_id )
{
	return this._textures[p_id];
};

TextureManager.prototype.destroy = function()
{
	TextureManager._instance = null;
	this._textures = null;
	delete this._textures;	
};